package com.jasmine.bjstkserver.server.article.log.draftlog;

import com.jasmine.auth.util.AuthUtil;
import com.jasmine.bjstkserver.server.article.online.model.ArticleReq;
import com.jasmine.core.dto.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jasmineXz
 */
@RestController
@RequestMapping("/article/draft/log")
public class DraftLogController {


    @Autowired
    private DraftLogServiceImpl draftLogService;

    /**
     * 查询发布文章列表
     * @param article 查询条件
     * @return 文章列表
     */
    @GetMapping("/list")
    public R findList (@ModelAttribute ArticleReq article){
        article.setUserId(AuthUtil.getUserId());
        return R.ok(draftLogService.findList(article));
    }
}
